<div id="transactionList">
  {if $corp}
  <div class="listOptions">
    <span>Account: 
      <select id="accountKey" onchange="window.location='{$site_url}/?module=transactions&corp=1&accountKey='+this.value">
        {foreach from=$accounts item=acc}
          <option value="{$acc.key}" {if $accountKey == $acc.key}selected="selected"{/if}>{$acc.description}</option>
        {/foreach}
      </select>
    </span>
  </div>
  {/if}

  {if $pageCount > 0}
  <div align="right">
    {if $prevPage < $pageNum}
      <button onclick="window.location='{$site_url}/?module=transactions{if $corp}&corp=1&accountKey={$accountKey}{/if}&p={$prevPage}'" class="pageNav"> &lt;&lt; </button>
    {/if}
    &nbsp; pg {$pageNum+1} / {$pageCount} &nbsp;
    {if $nextPage < $pageCount}
      <button onclick="window.location='{$site_url}/?module=transactions{if $corp}&corp=1&accountKey={$accountKey}{/if}&p={$nextPage}'" class="pageNav"> &gt;&gt; </button>
    {/if}
  </div>
  {/if}

  <table width="100%" border="0">
    <tr>
      <th>Item</th>
      <th>Qty</th>
      <th>Value</th>
      <th>Time</th>
      {if $corp}<th>Corp Member</th>{/if}
      <th>Buyer/Seller</th>
      <th>Station</th>
    </tr>
    {foreach from=$trans item=t}
      <tr class="{cycle values='row,rowAlt'}">
        <td>
          <a href="#" onclick="showInfo({$t.item.typeid});return false;">
            {if $t.item.typeGraphic}
              <img src="{$site_url}/eveimages/types/32/{$t.item.typeid}.png" alt="{$t.item.typename}" align="absmiddle" />
            {else}
              <img src="{$site_url}/eveimages/icons/32/icon{$t.item.icon}.png" alt="{$t.item.typename}" align="absmiddle" />
            {/if}
          </a>
          {$t.item.typename}
        </td>
        <td align="right">{$t.qty|eveNumInt}</td>
        {if $t.purchase}
          <td align="right" class="moneyOut">-{$t.totalPrice|eveNum}</td>
        {else}
          <td align="right" class="moneyIn">{$t.totalPrice|eveNum}</td>
        {/if}
        <td align="center">{$t.transactionTime|date_format:"%d/%m/%Y %H:%M"}</td>
        {if $corp}<td>{$t.characterName}</td>{/if}
        <td>{$t.clientName}</td>
        <td>{$t.station.stationname}</td>
      </tr>
    {/foreach}
  </table>

  {if !$trans}
    <h3>No market transactions found!</h3>
  {/if}

</div>